package com.wt.springsamples.biz.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wt.springsamples.biz.mybatis.mapper.SysFunctionMapper;
import com.wt.springsamples.common.BizException;
import com.wt.springsamples.model.SysFunction;
import com.wt.springsamples.biz.service.ISysFunctionService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("sysFunctionService")
public class SysFunctionServiceImpl extends ServiceImpl<SysFunctionMapper,SysFunction> implements ISysFunctionService {

    @Override
    public boolean update(SysFunction entity) {
        if(entity.getId()==null){
            throw new BizException(5001,"id不能为空");
        }
        return super.updateById(entity);
    }

    @Override
    public void deleteById(Long id) {
        super.removeById(id);
    }

    @Override
    public void deleteByIds(List<Long> ids) {
        super.removeByIds(ids);
    }

    @Override
    public List<SysFunction> getAll() {
        return super.list();
    }
}
